<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

<script src="./6-promise.js"></script>
<script>

let p1 = new Promise((resolve,reject)=>{// excutor执行器函数
    console.log( '执行器函数...' );
    // resolve(123);// 修改为成功状态
    reject(456);// 修改为失败状态
    // alort('hello');// 异常,修改失败状态
    // throw 789;// 异常,修改失败状态
})
console.log( p1 );// Promise {state: 'rejected', result: 789}

</script>
</body>
</html>